home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / sort2.zip / SORT.VAR < prev    next >
Text File  |  1993-01-04  |  2KB  |  71 lines

  1. { Global variable declarations for SORT }
  2.  
  3. var
  4.     { Booleans for handling option switches, etc. }
  5.     ancase,        { if true, ignore non-alphanumerics }
  6.     earlyout,      { set to true if insufficient memory for sort }
  7.     helponly,      { set to true if user was help message only }
  8.     ignoreblanks,  { set to true on "/b" option }
  9.     isfirst,
  10.     islast,
  11.     keysonly,      { if true, write only the key fields on output }
  12.     linefound,     { an identical data line has already been entered }
  13.     reversed,      { reverse the sense of the sort "/r" }
  14.     sensecase,     { if true, "a"="A"; if false, "a">"A" }
  15.     sorterror,     { set to true if sort integrity is in question }
  16.     sortnumeric,   { set to true on "/n" option }
  17.     unique,        { set to true on "/u" option }
  18.     usefields      { set to true on "/f" option }
  19.                    : boolean;
  20.  
  21.     delimset       : set of char;
  22.  
  23.     i,             { generic counter }
  24.     keycol,
  25.     keycol2,
  26.     parmcount      { paramcount of first filename }
  27.                    :integer;
  28.  
  29.     nlks,          { actual key column and length for new line }
  30.     nlkl
  31.                    :byte;
  32.  
  33.     fe,            { text file for error messages }
  34.     fi             { text file for reading lines to be sorted }
  35.                    :text;
  36.  
  37.     key,
  38.     pname,         { Name of the program ("SORT" by default ) }
  39.     s:string;
  40.  
  41.     kn:real;       { Numeric key }
  42.  
  43.     { Btree record pointers }
  44.     root,
  45.     firstnode,
  46.     lastnode,
  47.     current
  48.                    :lp;
  49.  
  50.     nodecount:longint;
  51.  
  52.     { variables to handle fsplit and findfirst/findnext file searches }
  53.     fstr:pathstr;
  54.     d:dirstr;
  55.     n:namestr;
  56.     x:extstr;
  57.     sr:searchrec;
  58.  
  59. { Global variable initialization }
  60. procedure sortinit; begin
  61.  
  62. freemin:=16000; sorterror:=false; earlyout:=false; root:=nil;
  63. firstnode:=nil; lastnode:=nil; nodecount:=0; ignoreblanks:=false;
  64. reversed:=false; sortnumeric:=false; sensecase:=defaultcase; keycol:=0;
  65. keycol2:=0; unique:=false; helponly:=false; usefields:=false;
  66. ancase:=false; delimset:=[]; keysonly:=false;
  67.  
  68. fsplit(paramstr(0),d,pname,x); if pname='' then pname:='SORT';
  69.  
  70. end;
  71.